Functions
Serial Port Control

Includes APIs for controlling serial ports to realize communication with serial port device (such as liquid lens) connected to the camera. More...

Functions

def MV_CC_SerialPort_Open (self)
 Opens the serial port. More...
 
def MV_CC_SerialPort_Write (self, pBuffer, nLength, pnWriteLen)
 Writes data to the serial port, allowing a maximum of 512 bytes written at a time. More...
 
def MV_CC_SerialPort_Read (self, pBuffer, nLength, pnReadLen, nMsec)
 Reads the serial port data. More...
 
def MV_CC_SerialPort_ClearBuffer (self)
 Clears the received serial port data. More...
 
def MV_CC_SerialPort_Close (self)
 Closes the serial port. More...
 

Detailed Description

Includes APIs for controlling serial ports to realize communication with serial port device (such as liquid lens) connected to the camera.

Function Documentation

◆ MV_CC_SerialPort_Open()

def MvCameraControl_class.MV_CC_SerialPort_Open (   self)

Opens the serial port.

Parameters
handle[IN] It refers to the device handle.
Returns
Returns MV_OK for success, and returns corresponding Error Code for failure.
Remarks
This API is supported by serial port devices.

◆ MV_CC_SerialPort_Write()

def MvCameraControl_class.MV_CC_SerialPort_Write (   self,
  pBuffer,
  nLength,
  pnWriteLen 
)

Writes data to the serial port, allowing a maximum of 512 bytes written at a time.

Parameters
handle[IN] It refers to the device handle.
pBuffer[IN] It refers to the data buffer.
nLength[IN] It refers to the data length.
pnWriteLen[OUT] It refers to the actual written data length.
Returns
Returns MV_OK for success, and returns corresponding Error Code for failure.
Remarks
The API is in blocking mode, returning the result only when all data has been successfully transmitted or transmission fails.

◆ MV_CC_SerialPort_Read()

def MvCameraControl_class.MV_CC_SerialPort_Read (   self,
  pBuffer,
  nLength,
  pnReadLen,
  nMsec 
)

Reads the serial port data.

Parameters
handle[IN] It refers to the device handle.
pBuffer[IN] It refers to the data buffer.
nLength[IN] It refers to the data length.
pnReadLen[IN] It refers to the reader data length.
nMsec[IN] It refers to the timeout duration, unit: millisecond.
Returns
Returns MV_OK for success, and returns corresponding Error Code for failure.
Remarks
The API is in blocking mode, returning the result only when data is received, timed out, or exception occurs.

◆ MV_CC_SerialPort_ClearBuffer()

def MvCameraControl_class.MV_CC_SerialPort_ClearBuffer (   self)

Clears the received serial port data.

Parameters
handle[IN] It refers to the device handle.
Returns
Returns MV_OK for success, and returns corresponding Error Code for failure.
Remarks
This API is supported by serial port devices.

◆ MV_CC_SerialPort_Close()

def MvCameraControl_class.MV_CC_SerialPort_Close (   self)

Closes the serial port.

Parameters
handle[IN] It refers to the device handle.
Returns
Returns MV_OK for success, and returns corresponding Error Code for failure.
Remarks
This API is supported by serial port devices.